import { _decorator, Component, Node, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Car')
export class Car extends Component {
    mX:number=0;
    mY:number=0;
    mZ:number=0;

    start () {
        this.mX=this.node.position.x;
        this.mY=this.node.position.y;
        this.mZ=this.node.position.z;
    }

    update (deltaTime: number) {
        this.mZ-=0.2;
        this.node.position=new Vec3(this.mX,this.mY,this.mZ);
    }
}
